home *** CD-ROM | disk | FTP | other *** search
/ NOVA - For the NeXT Workstation / NOVA - For the NeXT Workstation.iso / SourceCode / AdobeExamples / NX_ImportInt / GraphicImport.h < prev    next >
Encoding:
Text File  |  1992-12-19  |  3.7 KB  |  127 lines

  1.  
  2. /*
  3.  * (a)  (C) 1990 by Adobe Systems Incorporated. All rights reserved.
  4.  *
  5.  * (b)  If this Sample Code is distributed as part of the Display PostScript
  6.  *    System Software Development Kit from Adobe Systems Incorporated,
  7.  *    then this copy is designated as Development Software and its use is
  8.  *    subject to the terms of the License Agreement attached to such Kit.
  9.  *
  10.  * (c)  If this Sample Code is distributed independently, then the following
  11.  *    terms apply:
  12.  *
  13.  * (d)  This file may be freely copied and redistributed as long as:
  14.  *    1) Parts (a), (d), (e) and (f) continue to be included in the file,
  15.  *    2) If the file has been modified in any way, a notice of such
  16.  *      modification is conspicuously indicated.
  17.  *
  18.  * (e)  PostScript, Display PostScript, and Adobe are registered trademarks of
  19.  *    Adobe Systems Incorporated.
  20.  * 
  21.  * (f) THE INFORMATION BELOW IS FURNISHED AS IS, IS SUBJECT TO
  22.  *    CHANGE WITHOUT NOTICE, AND SHOULD NOT BE CONSTRUED
  23.  *    AS A COMMITMENT BY ADOBE SYSTEMS INCORPORATED.
  24.  *    ADOBE SYSTEMS INCORPORATED ASSUMES NO RESPONSIBILITY
  25.  *    OR LIABILITY FOR ANY ERRORS OR INACCURACIES, MAKES NO
  26.  *    WARRANTY OF ANY KIND (EXPRESS, IMPLIED OR STATUTORY)
  27.  *    WITH RESPECT TO THIS INFORMATION, AND EXPRESSLY
  28.  *    DISCLAIMS ANY AND ALL WARRANTIES OF MERCHANTABILITY, 
  29.  *    FITNESS FOR PARTICULAR PURPOSES AND NONINFRINGEMENT
  30.  *    OF THIRD PARTY RIGHTS.
  31.  */
  32.  
  33. /*
  34. *    GraphicImport.h
  35. *
  36. *    This subclass of handles much of the overhead for imported
  37. *    files such as tiff files and EPS files. Subclasses of this object
  38. *    provide the specific methods that differeniate the two.
  39. *
  40. *    Version:    2.0
  41. *    Author:    Ken Fromm
  42. *    History:
  43. *            03-20-91        Created the file.
  44. */
  45.  
  46. #import <objc/Object.h>
  47. #import "ImportApp.h"
  48. #import "epsfstruct.h"
  49.  
  50. #import <appkit/graphics.h>
  51. #import <objc/hashtable.h>
  52.  
  53. #define  PTS_GRAPHIC        8
  54. #define  SIZE_MIN                16
  55. #define  IMAGE_MAX            1500        /* Maximum size for using an NXImage */
  56.  
  57. #define  LEFT                    0
  58. #define  MIDDLE                1
  59. #define  RIGHT                2
  60. #define  TOP                    0
  61. #define  BOTTOM                2
  62.  
  63. #define  XPOS                18
  64. #define  YPOS                49
  65.  
  66. @interface GraphicImport : Object
  67. {
  68.     NXAtom        filename;            /* the name of the file */
  69.  
  70.     id            image,            /* id of the NXImage that serves as the bit cache */
  71.                 imagerep;        /* id of the NXImage rep that draws the file */
  72.  
  73.     NXRect        bounds;            /* the non-rotated bounding box in the document */
  74.  
  75.     struct _gflags {
  76.         unsigned char  new:1;            /* constrained to original aspect when new */
  77.         unsigned char  selected:1;        /* selected or not */
  78.         unsigned char  dirty:1;            /* needs to be redrawn */
  79.         unsigned char  unimageable:1;    /* cannot be imaged - (path not valid) */
  80.         unsigned char  error:1;            /* error when imaging */
  81.         unsigned char  filler:3;
  82.     } gflags;
  83. }
  84.  
  85. - initFromFile:(const char *) file;
  86.  
  87. - (BOOL) listUnavailableResources:(ResourceList *) resourceList;
  88. - addResources:(Resource *) resourceDoc  for:(NXRect *) r;
  89.  
  90. - free;
  91. - freeTemp;
  92. - copy; 
  93.  
  94. - setFilename:(const char *) file;
  95. - setImage:anImage;
  96. - setImageRep:anImageRep;
  97.  
  98. - setSelected:(BOOL) flag;
  99. - (BOOL) selected;
  100. - (BOOL) error;
  101.  
  102. - setPoint:(int) pt_num  :(const NXPoint *) pt;
  103. - setSize:(const NXSize *) aSize;
  104. - setOrigin:(const NXPoint *) pt;
  105. - setBounds:(const NXRect *) aRect;
  106.  
  107. - moveAll:(const NXPoint *) pt;
  108.  
  109. - getPoint:(int) pt_num  :(NXPoint *) pt;
  110. - getBounds:(NXRect *)aRect;
  111.  
  112. - constrainPoint:(NXPoint *)aPt  forPtNum:(int *) pt_num
  113.         inRect:(const NXRect *) viewRect  withFlags:(int) flags;
  114.  
  115. - hitControl:(const NXRect *) hitRect  :(int *) pt_num  forSize:(float) size;
  116. - hitObject:(UPath *) hitUpath;
  117.  
  118. - putControlPoints:(UPath *)buffer  forRect:(NXRect *)r  :(NXPoint *) lastPoint;
  119.  
  120. - drawBoxforRect:(NXRect *) r  imaging:(BOOL) imageFlag;
  121. - drawObject:(NXRect *) r  withFlags:(int) flags  inView:view;
  122.  
  123. - displayError;
  124.  
  125. @end
  126.  
  127.